package com.zhixianggou.caibaobox.lottery.dataShow;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhixianggou.caibaobox.commons.result.ReturnData;
import com.zhixianggou.caibaobox.lottery.dataCollect.cover.SLotteryCover;
import com.zhixianggou.caibaobox.lottery.dataCollect.cover.WLotteryCover;
import com.zhixianggou.caibaobox.lottery.dataCollect.dao.W3dMapper;
import com.zhixianggou.caibaobox.lottery.dataCollect.dao.WKl8Mapper;
import com.zhixianggou.caibaobox.lottery.dataCollect.dao.WQlcMapper;
import com.zhixianggou.caibaobox.lottery.dataCollect.dao.WSsqMapper;
import com.zhixianggou.caibaobox.lottery.dataCollect.entities.*;
import com.zhixianggou.caibaobox.lottery.dataShow.sco.SLotteryDateSco;
import com.zhixianggou.caibaobox.lottery.dataShow.sco.WLotteryDateSco;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zyq
 * 8/26/24 2:14 PM
 */
@Service
public class WLotteryService {

    @Resource
    WSsqMapper wSsqMapper;

    @Resource
    W3dMapper w3dMapper;

    @Resource
    WKl8Mapper wKl8Mapper;

    @Resource
    WQlcMapper wQlcMapper;

    /**
     * 福彩 双色球列表
     * @return
     */
    public ReturnData wSsqList(WLotteryDateSco sco){
        PageHelper.startPage(sco.getPageNum(),sco.getPageSize());
        List<WSsq> wSsqs = wSsqMapper.selectListBySco(sco);
        PageInfo pageInfo = new PageInfo<>(wSsqs);
        pageInfo.setList(WLotteryCover.INSTANCE.ssq2Vo(pageInfo.getList()));
        return ReturnData.success(pageInfo);
    }
    /**
     * 体彩 3d列表
     * @return
     */
    public ReturnData<PageInfo> threeDList(WLotteryDateSco sco) {
        PageHelper.startPage(sco.getPageNum(),sco.getPageSize());
        List<W3d> w3ds = w3dMapper.selectListBySco(sco);
        PageInfo pageInfo = new PageInfo<>(w3ds);
        pageInfo.setList(WLotteryCover.INSTANCE.w3d2Vo(pageInfo.getList()));
        return ReturnData.success(pageInfo);
    }
    /**
     * 体彩 排列5列表
     * @return
     */
    public ReturnData<PageInfo> kl8List(WLotteryDateSco sco) {
        PageHelper.startPage(sco.getPageNum(),sco.getPageSize());
        List<WKl8> wKl8s = wKl8Mapper.selectListBySco(sco);
        PageInfo pageInfo = new PageInfo<>(wKl8s);
        pageInfo.setList(WLotteryCover.INSTANCE.wkl82Vo(pageInfo.getList()));
        return ReturnData.success(pageInfo);
    }
    /**
     * 福彩 七乐彩
     * @return
     */
    public ReturnData qlcList(WLotteryDateSco sco) {
        PageHelper.startPage(sco.getPageNum(),sco.getPageSize());
        List<WQlc> wQlcs = wQlcMapper.selectListBySco(sco);
        PageInfo pageInfo = new PageInfo<>(wQlcs);
        pageInfo.setList(WLotteryCover.INSTANCE.wQlc2Vo(pageInfo.getList()));
        return ReturnData.success(pageInfo);
    }
}
